package com.yuye.cloud.common.feign;

import com.yuye.cloud.common.model.Result;
import com.yuye.cloud.common.constant.ServiceNameConstants;
import com.yuye.cloud.common.feign.fallback.HotspotDiscoveryServiceFallbackFactory;
import com.yuye.cloud.common.model.CacheEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 热点数据发现
 * @author xgf
 */
@FeignClient(name = ServiceNameConstants.HOTSPOT_DISCOVERY, fallbackFactory = HotspotDiscoveryServiceFallbackFactory.class, decode404 = true)
public interface HotspotDiscoveryService {
    /**
     * feign rpc访问远程/hotspot/submit接口
     * 查询用户实体对象CacheEntity
     *
     * @param cacheEntity 热点数据上传的实体数据
     * @return Result 上传是否成功
     */
    @PostMapping(value = "/hotspot/submit")
    Result hotspotSubmit(@RequestBody CacheEntity cacheEntity);

}
